#ifndef TCPSERVER_H
#define TCPSERVER_H

#include <QWidget>
#include<QTcpServer>
#include<QTcpSocket>
#include"mytcpserver.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class TcpServer;
}
QT_END_NAMESPACE

class TcpServer : public QWidget
{
    Q_OBJECT

public:
    TcpServer(QWidget *parent = nullptr);

    static TcpServer&getInstance();
    ~TcpServer();

    void loadConfig();

    void closeEvent(QCloseEvent *event) override;

public slots:
    void logRecording(const QString &logMsg);


private slots:
    void on_clearBtn_clicked();

    void on_exportBtn_clicked();

private:
    Ui::TcpServer *ui;

    MyTcpServer *m_tcpServer=nullptr;

    QString m_ip;
    unsigned short m_port;

};
#endif // TCPSERVER_H
